<!DOCTYPE html>


<html lang="zh-Hans">


<head>
  <meta charset="utf-8" />
    
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
  <title>
    访问互联网指南 |  Veal&#39;s Blog
  </title>
  <meta name="generator" content="hexo-theme-ayer">
  
  <link rel="shortcut icon" href="/favicon.ico" />
  
  
<link rel="stylesheet" href="/dist/main.css">

  
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/Shen-Yu/cdn/css/remixicon.min.css">

  
<link rel="stylesheet" href="/css/custom.css">

  
  
<script src="https://cdn.jsdelivr.net/npm/pace-js@1.0.2/pace.min.js"></script>

  
  

  

<link rel="alternate" href="/atom.xml" title="Veal's Blog" type="application/atom+xml">
<link href="https://cdn.bootcss.com/KaTeX/0.11.1/katex.min.css" rel="stylesheet" /></head>

</html>

<body>
  <div id="app">
    
      
    <main class="content on">
      <section class="outer">
  <article
  id="post-www"
  class="article article-type-post"
  itemscope
  itemprop="blogPost"
  data-scroll-reveal
>
  <div class="article-inner">
    
    <header class="article-header">
       
<h1 class="article-title sea-center" style="border-left:0" itemprop="name">
  访问互联网指南
</h1>
 

    </header>
     
    <div class="article-meta">
      <a href="/2020/03/12/www/" class="article-date">
  <time datetime="2020-03-12T08:51:39.000Z" itemprop="datePublished">2020-03-12</time>
</a> 
  <div class="article-category">
    <a class="article-category-link" href="/categories/%E6%8A%80%E6%9C%AF/">技术</a>
  </div>
  
<div class="word_count">
    <span class="post-time">
        <span class="post-meta-item-icon">
            <i class="ri-quill-pen-line"></i>
            <span class="post-meta-item-text"> Word count:</span>
            <span class="post-count">2.1k</span>
        </span>
    </span>

    <span class="post-time">
        &nbsp; | &nbsp;
        <span class="post-meta-item-icon">
            <i class="ri-book-open-line"></i>
            <span class="post-meta-item-text"> Reading time≈</span>
            <span class="post-count">7 min</span>
        </span>
    </span>
</div>
 
    </div>
      
    <div class="tocbot"></div>




  
    <div class="article-entry" itemprop="articleBody">
       
  <p>本篇文章提供通过<a href="https://github.com/XX-net/XX-Net" target="_blank" rel="noopener">XX-net</a>访问互联网的方式，尤其适用于Ipv6用户(高校、互联网大厂均分配ipv6)。</p>
<p>本篇仅提供ipv4-win10-chrome浏览器(最常见)接入XX-net方式以及常见问题的分析。</p>
<a id="more"></a>

<h2 id="原理分析"><a href="#原理分析" class="headerlink" title="原理分析"></a>原理分析</h2><p>首先我将对整个流程进行解读(瞎掰)，把握主体思路有利于解决半路杀出的bug。</p>
<p>XX-net的前身是GoAgent代理，采用python语言编写。与熟知的SS/SSR/V2arrayN代理相似，其也是通过中转海外服务器进行数据传输，但也有不同之处——XX-net接入谷歌数据中心利用云应用进行数据传输，因此它理论上是免费的。</p>
<p>利用以下数据传输图描述SS与XX-net数据传输路径:</p>
<p>SS客户端 &lt;=Socks5==&gt;(SSlocal&lt;=密文=&gt;)  SS服务端  —&gt;海外目标主机(谷歌)</p>
<p>XX-net客户端 &lt;==&gt; 全球谷歌数据中心 &lt;–&gt; 谷歌云GAE(需要通过开发者账户申请，XX-net提供公共AppId)</p>
<p>由此我们可以看出，XX-net通过扫描可用全球谷歌数据中心ip及接入白嫖谷歌云app实现免费数据传输(是呀不用租海外服务器了)。但是相比SS缺少加密机制，网络报文中会暴露数据隐私，但仅作科研使用问题不大。</p>
<p>根据我的体验来说，相比于SSR，XX-net的麻烦在于</p>
<ul>
<li><p>1 扫描可用的谷歌数据中心ip（出于种种原因，谷歌并没有被完全封锁，但活的ip也很少了）<br>以及遇到很奇怪的事，我分别开通过GAE香港和GAE美国，对于GAE香港检测ip通过率高于GAE美国(切换到美国可使用ip数会一直降)，或许可用ip数的检测是以两跳结果(ip中心–&gt;GAE)作为判断？</p>
</li>
<li><p>2 申请私用谷歌云app。尽管XX-net提供公用ip，但是用的人数过多因此限制仅浏览网页，禁止观看视频或下载。</p>
</li>
<li><p>3 对移动端支持不好。爱折腾如我都懒得折腾了…但你可以梅林路由器跑全局！</p>
</li>
</ul>
<p>以下部分在叙述基本使用方法的同时会兼顾以上三个难点的分析。</p>
<h2 id="安装XX-net"><a href="#安装XX-net" class="headerlink" title="安装XX-net"></a>安装XX-net</h2><ul>
<li><p>1 认准github地址，下载对应版本<a href="https://github.com/XX-net/XX-Net/blob/master/code/default/download.md" target="_blank" rel="noopener">XX-net</a></p>
</li>
<li><p>2 解压后点击 start.vbs进行安装。如弹出是否信任，是否授权，一律同意。</p>
</li>
<li><p>3 此时chrome浏览器将弹出localhost:8085要求进行相关配置。同时在电脑侧边栏将看到XX-net运行标志，右键修改代理方式为全局PAC智能代理。</p>
</li>
</ul>
<p>插曲: 我也试了浏览器代理方式，但似乎…效果不太行…所以我感觉修改为全局PAC智能代理就可以啦。项目作者提供的两种方法二选一即可，这里即为PAC代理方法</p>
<p><a href="https://github.com/XX-net/XX-Net/wiki/%E4%BD%BF%E7%94%A8Chrome%E6%B5%8F%E8%A7%88%E5%99%A8" target="_blank" rel="noopener">官方方法</a></p>
<p>注意，如果你的chrome浏览器过高，可能是不支持拖入crx文件安装拓展的。</p>
<h2 id="测试能否通过公共id访问互联网"><a href="#测试能否通过公共id访问互联网" class="headerlink" title="测试能否通过公共id访问互联网"></a>测试能否通过公共id访问互联网</h2><p>以上仅完成客户端安装，由于客户端内自带公共id，因此根据原理分析可知，此时需要扫描可用谷歌数据中心ip。</p>
<p>注意到作者的哭诉</p>
<p><em>由于封锁严重，软件自带IP已经被封杀殆尽。因此需要数分钟到数小时的初始化IP扫描，方能正常运行。</em></p>
<p>在8085端口的配置页我们可以看到状态:</p>
<p><img src="https://i.loli.net/2020/03/12/kKc7umHX5FoONlS.png" alt="pic1.png"></p>
<p>对于刚安装完XX-net的情况下，通常你并不会那么幸运看到这行蓝字，更多的是</p>
<p><em>尚未建立连接</em><br><em>建议开启ipv6或XX-Tunel</em><br><em>浏览器配置有问题</em></p>
<p>如果是3，请检查浏览器代理设置是否为OK，如果不是，重启XX-net客户端。如果重启失败，参考<a href="https://github.com/XX-net/XX-Net/wiki/How-to-get-start-error-log" target="_blank" rel="noopener">这里</a></p>
<p>如果是1或2，此时检查有效ip数是否为0以及连接池是否为0:0:0。如果是，说明暂时未扫描到可用的谷歌数据中心ip。</p>
<p>如何解决？</p>
<ul>
<li>1 增大扫描强度。按如下参数进行设置</li>
</ul>
<p><img src="https://i.loli.net/2020/03/12/oPw46SWHkaugRZG.png" alt="pic2.png"><br><img src="https://i.loli.net/2020/03/12/i2CKNbjkFDXsynV.png" alt="pic3.png"></p>
<p>记得修改后提交</p>
<ul>
<li>2 查看扫描日志 是否正在扫描，如作者所言，初始化扫描需要数分钟到小时，耐心等待。</li>
</ul>
<p><img src="https://i.loli.net/2020/03/12/yNY1VxauzismM4e.png" alt="pic4.png"></p>
<p>嗯，我能用的ip背后有多少time out的ip牺牲了。</p>
<p>所以强烈ipv6用户开启ipv6服务，在设置页也进行详尽介绍。但超出本文范围(目前没得ipv6用啊)相信我，一旦开启ipv6，扫描ip数瞬间上百！</p>
<p>以及理论上，不心疼电费可以把电脑开机联网让它扫描个几天几夜，这样你就会拥有很多可用ip！</p>
<ul>
<li>3 如果还是未连接…</li>
</ul>
<p>可以联系获取可用ip…不过作为ipv6用户能不和可怜的ipv4用户抢ip了么呜呜呜。</p>
<p>当你查看状态，出现和我一致的蓝字，那么恭喜你，可成功访问真正的互联网了！</p>
<h2 id="部署私有AppId"><a href="#部署私有AppId" class="headerlink" title="部署私有AppId"></a>部署私有AppId</h2><p>此步可选，如果用gmail账号且不怕麻烦，建议这样做。由于AppId每天限制流量1G且个人gmail账号app申请受限，假如你是我的密友且计算机接触不多，我会部署好app并把个人id给你用，直接进入<strong>录入AppId</strong>。(虽然我喜欢研究技术，但真正的收获是理清系统思路而不是给别人当24小时客服吧，我又没对谁收费过。)</p>
<p>为了减缓公共资源的使用，建议申请私有AppId，也即你的谷歌云应用。申请方式如下</p>
<ul>
<li>1 注册谷歌gmail账号</li>
</ul>
<p>注册gmail账号需要海外手机号接收短信，欢迎在海外留学的同学帮忙接收注册验证码，不会对你造成负面影响，作为答谢在网络可用情形下为你部署app。</p>
<ul>
<li><p>2 用gmail账号登录谷歌云申请私人AppId</p>
<ul>
<li><p>1 创建你的云应用<br>  进入<a href="https://console.cloud.google.com/start" target="_blank" rel="noopener">网页</a><br>  点击选择项目，然后点击创建项目<br>  <img src="https://cloud.githubusercontent.com/assets/19320102/26750556/af503ee2-4858-11e7-811b-30367691d912.png" alt="avatar"><br>  <img src="https://cloud.githubusercontent.com/assets/19320102/26750550/6abaaed4-4858-11e7-8386-e07f0391325f.png" alt="avatar"></p>
<p>  输入project名称系统自动生成AppId(ProjectId),请不要填写个人信息相关，web ios android也请不要写。</p>
</li>
<li><p>2 设置AppID的App引擎</p>
<p>  访问APP引擎信息中心， <a href="https://console.cloud.google.com/appengine/start?project=你的项目id" target="_blank" rel="noopener">https://console.cloud.google.com/appengine/start?project=你的项目id</a></p>
<p>  选择地点默认us-central即可。(但有条件的建议选择asia-east2香港节点)</p>
<p>  默认项目语言即为python，无需修改。绑定信用卡(biling)为可选项，跳过即可。查看右上角创建状态，如成功 返回8085进行部署。</p>
<p>  同时热烈欢迎有条件的朋友绑信用卡，我想体验下谷歌赠送的一年期的云服务器…(不会像AWS自动续费，而且申请服务器后随时都可解绑吧)</p>
</li>
<li><p>3 部署AppId</p>
<p>  回到8085界面 进行部署<br><img src="https://i.loli.net/2020/03/12/vcUmYHMQIAVxGXe.png" alt="pic5.png"></p>
<p>输入2获取的AppId，点击开始部署，打开显示日志并密切监控。请允许浏览器弹出窗口，经过若干分钟的等待后会进入gmail授权界面，当出现部署成功后，则该AppId可用。</p>
<p>番外: 这里有个bug，就是初始扫描获得的ip延迟挺大的，导致gmail授权界面经常出现504错误。嗯…这时不要着急，根据我对日志的观察客户端会反复尝试直至登入。<br>所以我还在想，是否有种方式可以不通过XX-net而直接对app进行部署呢？(因为我有买稳梯子连入谷歌)这样就可以直接进入录入ID环节，无需过久等待。<br>我找到了，在接入稳梯子的情形下可使用脚本部署<br><a href="https://github.com/XX-net/XX-Net/tree/master/code/default/gae_proxy/server" target="_blank" rel="noopener">脚本部署</a></p>
</li>
</ul>
</li>
</ul>
<h2 id="录入AppId"><a href="#录入AppId" class="headerlink" title="录入AppId"></a>录入AppId</h2><p><img src="https://i.loli.net/2020/03/12/6FrN45azPjUQ3MC.png" alt="pic6.png"></p>
<p>公共Id只能浏览网页，不能下载，不能看视频。因此私有Id还是很有必要的。</p>
<p>在这里进行录入Id的配置，将已经成功部署的AppId填入就可以啦。当然啦，你也可以从好朋友那里获得已部署的AppId进行录入。经过若干分钟的等待，你就可以自由看视频啦！</p>
<h2 id="结语"><a href="#结语" class="headerlink" title="结语"></a>结语</h2><p>请大家去github上支持下作者！<br>有钱的出钱，支持<a href="https://github.com/XX-net/XX-Net/wiki/X-Tunnel%E4%BB%8B%E7%BB%8D" target="_blank" rel="noopener">X-Tunnel</a> 年度会员15美元,月均10rmb不到<br>有账号的出账号，捐赠私有AppId作为公共Id<br>如果想感谢我也欢迎（</p>
 
      <!-- reward -->
      
    </div>
    

    <!-- copyright -->
    
    <div class="declare">
      <ul class="post-copyright">
        <li>
          <i class="ri-copyright-line"></i>
          <strong>Copyright： </strong>
          Copyright is owned by the author. For commercial reprints, please contact the author for authorization. For non-commercial reprints, please indicate the source.
        </li>
      </ul>
    </div>
    
    <footer class="article-footer">
       
<div class="share-btn">
      <span class="share-sns share-outer">
        <i class="ri-share-forward-line"></i>
        分享
      </span>
      <div class="share-wrap">
        <i class="arrow"></i>
        <div class="share-icons">
          
          <a class="weibo share-sns" href="javascript:;" data-type="weibo">
            <i class="ri-weibo-fill"></i>
          </a>
          <a class="weixin share-sns wxFab" href="javascript:;" data-type="weixin">
            <i class="ri-wechat-fill"></i>
          </a>
          <a class="qq share-sns" href="javascript:;" data-type="qq">
            <i class="ri-qq-fill"></i>
          </a>
          <a class="douban share-sns" href="javascript:;" data-type="douban">
            <i class="ri-douban-line"></i>
          </a>
          <!-- <a class="qzone share-sns" href="javascript:;" data-type="qzone">
            <i class="icon icon-qzone"></i>
          </a> -->
          
          <a class="facebook share-sns" href="javascript:;" data-type="facebook">
            <i class="ri-facebook-circle-fill"></i>
          </a>
          <a class="twitter share-sns" href="javascript:;" data-type="twitter">
            <i class="ri-twitter-fill"></i>
          </a>
          <a class="google share-sns" href="javascript:;" data-type="google">
            <i class="ri-google-fill"></i>
          </a>
        </div>
      </div>
</div>

<div class="wx-share-modal">
    <a class="modal-close" href="javascript:;"><i class="ri-close-circle-line"></i></a>
    <p>扫一扫，分享到微信</p>
    <div class="wx-qrcode">
      <img src="//api.qrserver.com/v1/create-qr-code/?size=150x150&data=https://vealm.gitee.io/2020/03/12/www/" alt="微信分享二维码">
    </div>
</div>

<div id="share-mask"></div>  
  <ul class="article-tag-list" itemprop="keywords"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/Network/" rel="tag">Network</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/XX-net/" rel="tag">XX-net</a></li></ul>

    </footer>
  </div>

   
  <nav class="article-nav">
    
      <a href="/2020/07/07/labjupyter/" class="article-nav-link">
        <strong class="article-nav-caption">上一篇</strong>
        <div class="article-nav-title">
          
            jupyterlab激活虚拟环境
          
        </div>
      </a>
    
    
      <a href="/2020/03/09/grow/" class="article-nav-link">
        <strong class="article-nav-caption">下一篇</strong>
        <div class="article-nav-title">岁月过客</div>
      </a>
    
  </nav>

   
<!-- valine评论 -->
<div id="vcomments-box">
  <div id="vcomments"></div>
</div>
<script src="//cdn1.lncld.net/static/js/3.0.4/av-min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/valine@1.4.14/dist/Valine.min.js"></script>
<script>
  new Valine({
    el: "#vcomments",
    app_id: "854ziDXtPQxK8dJf2vsosmzN-gzGzoHsz",
    app_key: "kV9lcyv3dVA2I6pqA4yd23p6",
    path: window.location.pathname,
    avatar: "monsterid",
    placeholder: "给我的文章加点评论吧~",
    recordIP: true,
  });
  const infoEle = document.querySelector("#vcomments .info");
  if (infoEle && infoEle.childNodes && infoEle.childNodes.length > 0) {
    infoEle.childNodes.forEach(function (item) {
      item.parentNode.removeChild(item);
    });
  }
</script>
<style>
  #vcomments-box {
    padding: 5px 30px;
  }

  @media screen and (max-width: 800px) {
    #vcomments-box {
      padding: 5px 0px;
    }
  }

  #vcomments-box #vcomments {
    background-color: #fff;
  }

  .v .vlist .vcard .vh {
    padding-right: 20px;
  }

  .v .vlist .vcard {
    padding-left: 10px;
  }
</style>

 
     
</article>

</section>
      <footer class="footer">
  <div class="outer">
    <ul>
      <li>
        Copyrights &copy;
        2020
        <i class="ri-heart-fill heart_icon"></i> Veal
      </li>
    </ul>
    <ul>
      <li>
        
        
        
        Powered by <a href="https://hexo.io" target="_blank">Hexo</a>
        <span class="division">|</span>
        Theme - <a href="https://github.com/Shen-Yu/hexo-theme-ayer" target="_blank">Ayer</a>
        
      </li>
    </ul>
    <ul>
      <li>
        
        
        <span>
  <span><i class="ri-user-3-fill"></i>Visitors:<span id="busuanzi_value_site_uv"></span></s>
  <span class="division">|</span>
  <span><i class="ri-eye-fill"></i>Views:<span id="busuanzi_value_page_pv"></span></span>
</span>
        
      </li>
    </ul>
    <ul>
      
    </ul>
    <ul>
      <li>
        <!-- cnzz统计 -->
        
        <script type="text/javascript" src='https://s9.cnzz.com/z_stat.php?id=1278599897&amp;web_id=1278599897'></script>
        
      </li>
    </ul>
  </div>
</footer>
      <div class="float_btns">
        <div class="totop" id="totop">
  <i class="ri-arrow-up-line"></i>
</div>

<div class="todark" id="todark">
  <i class="ri-moon-line"></i>
</div>

      </div>
    </main>
    <aside class="sidebar on">
      <button class="navbar-toggle"></button>
<nav class="navbar">
  
  <div class="logo">
    <a href="/"><img src="/images/ayer-side.svg" alt="Veal&#39;s Blog"></a>
  </div>
  
  <ul class="nav nav-main">
    
    <li class="nav-item">
      <a class="nav-item-link" href="/">主页</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/archives">归档</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/categories">分类</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/tags">标签</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/Me">关于我</a>
    </li>
    
  </ul>
</nav>
<nav class="navbar navbar-bottom">
  <ul class="nav">
    <li class="nav-item">
      
      <a class="nav-item-link nav-item-search"  title="Search">
        <i class="ri-search-line"></i>
      </a>
      
      
      <a class="nav-item-link" target="_blank" href="/atom.xml" title="RSS Feed">
        <i class="ri-rss-line"></i>
      </a>
      
    </li>
  </ul>
</nav>
<div class="search-form-wrap">
  <div class="local-search local-search-plugin">
  <input type="search" id="local-search-input" class="local-search-input" placeholder="Search...">
  <div id="local-search-result" class="local-search-result"></div>
</div>
</div>
    </aside>
    <script>
      if (window.matchMedia("(max-width: 768px)").matches) {
        document.querySelector('.content').classList.remove('on');
        document.querySelector('.sidebar').classList.remove('on');
      }
    </script>
    
    <!--加入音乐播放器-->

    <div id="mask"></div>

<!-- #reward -->
<div id="reward">
  <span class="close"><i class="ri-close-line"></i></span>
  <p class="reward-p"><i class="ri-cup-line"></i>请我喝杯咖啡吧~</p>
  <div class="reward-box">
    
    <div class="reward-item">
      <img class="reward-img" src="https://cdn.jsdelivr.net/gh/Shen-Yu/cdn/img/alipay.jpg">
      <span class="reward-type">支付宝</span>
    </div>
    
    
    <div class="reward-item">
      <img class="reward-img" src="https://cdn.jsdelivr.net/gh/Shen-Yu/cdn/img/wechat.jpg">
      <span class="reward-type">微信</span>
    </div>
    
  </div>
</div>
    
<script src="/js/jquery-2.0.3.min.js"></script>


<script src="/js/lazyload.min.js"></script>

<!-- Tocbot -->


<script src="/js/tocbot.min.js"></script>

<script>
  tocbot.init({
    tocSelector: '.tocbot',
    contentSelector: '.article-entry',
    headingSelector: 'h1, h2, h3, h4, h5, h6',
    hasInnerContainers: true,
    scrollSmooth: true,
    scrollContainer: 'main',
    positionFixedSelector: '.tocbot',
    positionFixedClass: 'is-position-fixed',
    fixedSidebarOffset: 'auto'
  });
</script>

<script src="https://cdn.jsdelivr.net/npm/jquery-modal@0.9.2/jquery.modal.min.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/jquery-modal@0.9.2/jquery.modal.min.css">
<script src="https://cdn.jsdelivr.net/npm/justifiedGallery@3.7.0/dist/js/jquery.justifiedGallery.min.js"></script>

<script src="/dist/main.js"></script>

<!-- ImageViewer -->

<!-- Root element of PhotoSwipe. Must have class pswp. -->
<div class="pswp" tabindex="-1" role="dialog" aria-hidden="true">

    <!-- Background of PhotoSwipe. 
         It's a separate element as animating opacity is faster than rgba(). -->
    <div class="pswp__bg"></div>

    <!-- Slides wrapper with overflow:hidden. -->
    <div class="pswp__scroll-wrap">

        <!-- Container that holds slides. 
            PhotoSwipe keeps only 3 of them in the DOM to save memory.
            Don't modify these 3 pswp__item elements, data is added later on. -->
        <div class="pswp__container">
            <div class="pswp__item"></div>
            <div class="pswp__item"></div>
            <div class="pswp__item"></div>
        </div>

        <!-- Default (PhotoSwipeUI_Default) interface on top of sliding area. Can be changed. -->
        <div class="pswp__ui pswp__ui--hidden">

            <div class="pswp__top-bar">

                <!--  Controls are self-explanatory. Order can be changed. -->

                <div class="pswp__counter"></div>

                <button class="pswp__button pswp__button--close" title="Close (Esc)"></button>

                <button class="pswp__button pswp__button--share" style="display:none" title="Share"></button>

                <button class="pswp__button pswp__button--fs" title="Toggle fullscreen"></button>

                <button class="pswp__button pswp__button--zoom" title="Zoom in/out"></button>

                <!-- Preloader demo http://codepen.io/dimsemenov/pen/yyBWoR -->
                <!-- element will get class pswp__preloader--active when preloader is running -->
                <div class="pswp__preloader">
                    <div class="pswp__preloader__icn">
                        <div class="pswp__preloader__cut">
                            <div class="pswp__preloader__donut"></div>
                        </div>
                    </div>
                </div>
            </div>

            <div class="pswp__share-modal pswp__share-modal--hidden pswp__single-tap">
                <div class="pswp__share-tooltip"></div>
            </div>

            <button class="pswp__button pswp__button--arrow--left" title="Previous (arrow left)">
            </button>

            <button class="pswp__button pswp__button--arrow--right" title="Next (arrow right)">
            </button>

            <div class="pswp__caption">
                <div class="pswp__caption__center"></div>
            </div>

        </div>

    </div>

</div>

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/photoswipe@4.1.3/dist/photoswipe.min.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/photoswipe@4.1.3/dist/default-skin/default-skin.min.css">
<script src="https://cdn.jsdelivr.net/npm/photoswipe@4.1.3/dist/photoswipe.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/photoswipe@4.1.3/dist/photoswipe-ui-default.min.js"></script>

<script>
    function viewer_init() {
        let pswpElement = document.querySelectorAll('.pswp')[0];
        let $imgArr = document.querySelectorAll(('.article-entry img:not(.reward-img)'))

        $imgArr.forEach(($em, i) => {
            $em.onclick = () => {
                // slider展开状态
                // todo: 这样不好，后面改成状态
                if (document.querySelector('.left-col.show')) return
                let items = []
                $imgArr.forEach(($em2, i2) => {
                    let img = $em2.getAttribute('data-idx', i2)
                    let src = $em2.getAttribute('data-target') || $em2.getAttribute('src')
                    let title = $em2.getAttribute('alt')
                    // 获得原图尺寸
                    const image = new Image()
                    image.src = src
                    items.push({
                        src: src,
                        w: image.width || $em2.width,
                        h: image.height || $em2.height,
                        title: title
                    })
                })
                var gallery = new PhotoSwipe(pswpElement, PhotoSwipeUI_Default, items, {
                    index: parseInt(i)
                });
                gallery.init()
            }
        })
    }
    viewer_init()
</script>

<!-- MathJax -->

<script type="text/x-mathjax-config">
  MathJax.Hub.Config({
      tex2jax: {
          inlineMath: [ ['$','$'], ["\\(","\\)"]  ],
          processEscapes: true,
          skipTags: ['script', 'noscript', 'style', 'textarea', 'pre', 'code']
      }
  });

  MathJax.Hub.Queue(function() {
      var all = MathJax.Hub.getAllJax(), i;
      for(i=0; i < all.length; i += 1) {
          all[i].SourceElement().parentNode.className += ' has-jax';
      }
  });
</script>

<script src="https://cdn.jsdelivr.net/npm/mathjax@2.7.6/unpacked/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<script>
  var ayerConfig = {
    mathjax: true
  }
</script>

<!-- Katex -->


    
        <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/katex.min.css">
        <script src="https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/katex.min.js"></script>
        <script src="https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/contrib/auto-render.min.js"></script>
        
    


<!-- busuanzi  -->


<script src="/js/busuanzi-2.3.pure.min.js"></script>


<!-- ClickLove -->

<!-- ClickBoom1 -->

<!-- ClickBoom2 -->

<!-- CodeCopy -->


<link rel="stylesheet" href="/css/clipboard.css">

<script src="https://cdn.jsdelivr.net/npm/clipboard@2/dist/clipboard.min.js"></script>
<script>
  function wait(callback, seconds) {
    var timelag = null;
    timelag = window.setTimeout(callback, seconds);
  }
  !function (e, t, a) {
    var initCopyCode = function(){
      var copyHtml = '';
      copyHtml += '<button class="btn-copy" data-clipboard-snippet="">';
      copyHtml += '<i class="ri-file-copy-2-line"></i><span>COPY</span>';
      copyHtml += '</button>';
      $(".highlight .code pre").before(copyHtml);
      $(".article pre code").before(copyHtml);
      var clipboard = new ClipboardJS('.btn-copy', {
        target: function(trigger) {
          return trigger.nextElementSibling;
        }
      });
      clipboard.on('success', function(e) {
        let $btn = $(e.trigger);
        $btn.addClass('copied');
        let $icon = $($btn.find('i'));
        $icon.removeClass('ri-file-copy-2-line');
        $icon.addClass('ri-checkbox-circle-line');
        let $span = $($btn.find('span'));
        $span[0].innerText = 'COPIED';
        
        wait(function () { // 等待两秒钟后恢复
          $icon.removeClass('ri-checkbox-circle-line');
          $icon.addClass('ri-file-copy-2-line');
          $span[0].innerText = 'COPY';
        }, 2000);
      });
      clipboard.on('error', function(e) {
        e.clearSelection();
        let $btn = $(e.trigger);
        $btn.addClass('copy-failed');
        let $icon = $($btn.find('i'));
        $icon.removeClass('ri-file-copy-2-line');
        $icon.addClass('ri-time-line');
        let $span = $($btn.find('span'));
        $span[0].innerText = 'COPY FAILED';
        
        wait(function () { // 等待两秒钟后恢复
          $icon.removeClass('ri-time-line');
          $icon.addClass('ri-file-copy-2-line');
          $span[0].innerText = 'COPY';
        }, 2000);
      });
    }
    initCopyCode();
  }(window, document);
</script>


<!-- CanvasBackground -->


    
  </div>
</body>

</html>